๐Ÿ“Š Data Representation Methods

Chapter 3 - ICT Grade 10

๐Ÿ” Introduction

When you press a key on your keyboard, how does the computer understand it? Computers don't understand letters, numbers, or images the way we do. They convert everything into a language they can process - binary code (0s and 1s).

๐Ÿ’ก Key Concept: Computers work with electronic circuits that have two states: ON (1) and OFF (0). Everything - text, images, sounds, videos - is converted into combinations of these two digits.

๐Ÿ”ข Number Systems

A number system is a way of representing numbers using a specific set of symbols (digits). The computer uses four main number systems:

Number System Base Digits Used
Binary 2 0, 1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Hexadecimal 16 0-9, A, B, C, D, E, F

1. Binary Number System (Base 2)

Why Binary? Computers use electronic circuits with two voltage levels (high/low), which perfectly match the two binary digits (0 and 1).

Example: The number 13 in decimal = 1101 in binary

1101โ‚‚ = (1ร—2ยณ) + (1ร—2ยฒ) + (0ร—2ยน) + (1ร—2โฐ) = 8 + 4 + 0 + 1 = 13โ‚โ‚€

2. Octal Number System (Base 8)

Uses 8 digits (0-7). Each octal digit can be represented by exactly 3 binary digits.

Example: 236โ‚ˆ = (2ร—8ยฒ) + (3ร—8ยน) + (6ร—8โฐ) = 128 + 24 + 6 = 158โ‚โ‚€

3. Decimal Number System (Base 10)

This is the number system we use in everyday life with digits 0-9.

4. Hexadecimal Number System (Base 16)

Uses 16 symbols: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15)

Why Hexadecimal? It's easier for humans to read than long binary numbers. Each hex digit represents exactly 4 binary digits.

Example: Color codes in web design use hexadecimal: #FF0000 = Red

๐Ÿ”„ Number System Conversions

Converting Decimal to Binary

Example: Convert 25โ‚โ‚€ to binary
  1. Divide 25 by 2 = 12 remainder 1
  2. Divide 12 by 2 = 6 remainder 0
  3. Divide 6 by 2 = 3 remainder 0
  4. Divide 3 by 2 = 1 remainder 1
  5. Divide 1 by 2 = 0 remainder 1
  6. Read remainders from bottom to top: 11001โ‚‚

Converting Binary to Decimal

Example: Convert 1101โ‚‚ to decimal

1101โ‚‚ = (1ร—2ยณ) + (1ร—2ยฒ) + (0ร—2ยน) + (1ร—2โฐ)

= 8 + 4 + 0 + 1 = 13โ‚โ‚€

Binary โ†” Octal Conversion

Rule: Group binary digits in sets of 3 (from right to left)

Example: 1011101โ‚‚ to Octal

001 | 011 | 101 = 1 | 3 | 5 = 135โ‚ˆ

Binary โ†” Hexadecimal Conversion

Rule: Group binary digits in sets of 4 (from right to left)

Example: 10110โ‚‚ to Hexadecimal

0001 | 0110 = 1 | 6 = 16โ‚โ‚†

๐Ÿ“ Most and Least Significant Positions

Most Significant Digit (MSD) & Least Significant Digit (LSD)

MSD: The leftmost non-zero digit (has the greatest value)

LSD: The rightmost non-zero digit (has the smallest value)

Example: In 3290, MSD = 3, LSD = 9 (not 0)

Most Significant Bit (MSB) & Least Significant Bit (LSB)

Same concept but specifically for binary numbers:

Example: 1101โ‚‚
  • MSB = 1 (leftmost, value = 2ยณ = 8)
  • LSB = 1 (rightmost, value = 2โฐ = 1)

๐Ÿ’พ Data Storage Capacity

Storage Units

Unit Value Description
Bit - Smallest unit (0 or 1)
Nibble 4 bits Half a byte
Byte 8 bits Can store one character
Kilobyte (KB) 1024 bytes About half a page of text
Megabyte (MB) 1024 KB About 500 pages of text
Gigabyte (GB) 1024 MB About 500,000 pages
Terabyte (TB) 1024 GB About 500 million pages
Petabyte (PB) 1024 TB Massive data centers
โš ๏ธ Remember: 1 Byte = 8 Bits | 1 KB = 1024 Bytes (not 1000!)

๐Ÿ”ค Coding Systems

Coding systems are standard ways of representing characters (letters, numbers, symbols) as binary numbers.

1. BCD (Binary Coded Decimal)

Uses: 4 bits per decimal digit

Example: 37โ‚โ‚€ = 0011 0111 in BCD

Limitation: Can only represent decimal numbers (0-9)

2. ASCII (American Standard Code for Information Interchange)

Uses: 7 bits (can represent 128 characters)

Extended ASCII: 8 bits (256 characters)

Example: 'A' = 65โ‚โ‚€ = 1000001โ‚‚

Used for: English letters, numbers, basic symbols

3. EBCDIC (Extended Binary Coded Decimal Interchange Code)

Uses: 8 bits (256 characters)

Used in: IBM mainframe computers

Example: 'A' = 11000001โ‚‚

4. Unicode

Uses: 16 bits (can represent 65,536 characters)

Supports: All world languages including Sinhala, Tamil, Chinese, Japanese, Arabic, etc.

Example: Sinhala letters, emojis, mathematical symbols

Used in: Modern websites, applications, operating systems

๐Ÿ’ก Why Different Coding Systems?
  • ASCII: Good for English but can't handle other languages
  • Unicode: Universal standard supporting all languages and symbols

๐Ÿ“‹ Quick Reference Table

Decimal Binary Octal Hexadecimal
0000000
1000111
2001022
81000108
10101012A
15111117F
16100002010

๐Ÿ“ Practice Questions & Answers

Question 1:

Convert the decimal number 45โ‚โ‚€ to binary.

Answer: 101101โ‚‚

Steps:
45 รท 2 = 22 remainder 1
22 รท 2 = 11 remainder 0
11 รท 2 = 5 remainder 1
5 รท 2 = 2 remainder 1
2 รท 2 = 1 remainder 0
1 รท 2 = 0 remainder 1
Reading from bottom to top: 101101โ‚‚
Question 2:

Convert the binary number 11011โ‚‚ to decimal.

Answer: 27โ‚โ‚€

Calculation:
11011โ‚‚ = (1ร—2โด) + (1ร—2ยณ) + (0ร—2ยฒ) + (1ร—2ยน) + (1ร—2โฐ)
= 16 + 8 + 0 + 2 + 1
= 27โ‚โ‚€
Question 3:

How many bits are in 2 Kilobytes?

Answer: 16,384 bits

Calculation:
2 KB = 2 ร— 1024 bytes = 2048 bytes
2048 bytes ร— 8 bits = 16,384 bits
Question 4:

Convert the hexadecimal number 2Fโ‚โ‚† to binary.

Answer: 00101111โ‚‚

Steps:
2 in hex = 0010 in binary
F in hex = 1111 in binary
Combining: 00101111โ‚‚
Question 5:

What is the ASCII code for the letter 'A'?

Answer: 65โ‚โ‚€ or 1000001โ‚‚

Note: ASCII uses 7 bits to represent characters. 'A' is represented as decimal 65 or binary 1000001.
Question 6:

Convert octal number 157โ‚ˆ to binary.

Answer: 001101111โ‚‚

Steps:
1โ‚ˆ = 001โ‚‚
5โ‚ˆ = 101โ‚‚
7โ‚ˆ = 111โ‚‚
Combining: 001101111โ‚‚
Question 7:

Find the MSD and LSD of the number 3045.07โ‚โ‚€

Answer:
MSD (Most Significant Digit) = 3
LSD (Least Significant Digit) = 7

Note: MSD is the leftmost non-zero digit, LSD is the rightmost non-zero digit.
Question 8:

Why do computers use the binary number system instead of decimal?

Answer: Computers use electronic circuits that have two stable states: ON (high voltage) and OFF (low voltage). Binary digits 0 and 1 perfectly represent these two states. It's much easier and more reliable to distinguish between two states than ten states in electronic circuits.
Question 9:

Which coding system should be used to represent Sinhala text in a computer?

Answer: Unicode

Reason: Unicode uses 16 bits and can represent 65,536 different characters, which is sufficient for all world languages including Sinhala, Tamil, Chinese, Japanese, etc. ASCII and EBCDIC can only represent English characters and basic symbols.
Question 10:

Convert hexadecimal A5โ‚โ‚† to decimal.

Answer: 165โ‚โ‚€

Calculation:
A5โ‚โ‚† = (A ร— 16ยน) + (5 ร— 16โฐ)
= (10 ร— 16) + (5 ร— 1)
= 160 + 5
= 165โ‚โ‚€

๐Ÿ’ก Study Tips

  1. Practice Conversions: The more you practice converting between number systems, the easier it becomes.
  2. Remember the Powers: Memorize powers of 2 (2, 4, 8, 16, 32, 64, 128, 256...) for quick binary conversions.
  3. Use Grouping: When converting binary to octal (group of 3) or hexadecimal (group of 4), always group from right to left.
  4. Storage Units: Remember that 1 KB = 1024 bytes (not 1000). This is because computers use base 2.
  5. ASCII Codes: 'A' starts at 65, 'a' starts at 97. The difference is always 32.
  6. Draw Diagrams: Visual representations help understand how data flows from input to storage.